# -*- coding: utf-8 -*-
import os
# debug mode
debug = True

# get current directory
from os.path import abspath, dirname, join
base_path = abspath(dirname(__file__))

# system path
import sys
sys.path.insert(0, abspath(join(base_path, '..', 'lib')))

# configure session


# set template directory
from jinja2 import Environment, PackageLoader
env = Environment(loader=PackageLoader('{{ project_name }}', 'templates'), auto_reload=debug)

# database configuration
dburi = "mysql://user:password@127.0.0.1/db?charset=utf8&use_unicode=0"
from sqlalchemy import create_engine, MetaData
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.pool import NullPool, SingletonThreadPool, StaticPool
engine = create_engine(
    dburi,
    convert_unicode=True,
    encoding="utf-8",
    pool_recycle=3600*7,
    #echo_pool=True,
    echo=False,
)
metadata = MetaData(bind=engine)
session = scoped_session(sessionmaker(engine))
sqlalchemy_sessions = [session]

from accost import Rules
home = Rules()
